﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Public;
using BUS;

namespace QuanLyKhoHangVatTu
{
    public partial class Login : DevExpress.XtraEditors.XtraForm
    {
        TaiKhoan_BUS tk_bus = new TaiKhoan_BUS();
        TaiKhoan_PB tk_pb = new TaiKhoan_PB();

        public Login()
        {
            InitializeComponent();
        }

        private void btnDongY_Click(object sender, EventArgs e)
        {
            if (tk_bus.Login(txtUser.Text, txtPass.Text).Rows.Count > 0)
            {
                TaiKhoan_PB.TenDangNhap = txtUser.Text;
                this.Hide();

            }
            else
            {
                lblThongBao.Visible = true;
                txtPass.ResetText();
                txtPass.Focus();
            }
        }

        private void btnHuyBo_Click(object sender, EventArgs e)
        {
            this.Close();
            Application.Exit();
        }

        private void Login_Load(object sender, EventArgs e)
        {

        }
    }
}